package com.sj.parksdk.widget.MRTextView;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import androidx.appcompat.widget.AppCompatTextView;

import com.ruffian.library.widget.iface.RHelper;

public class MRTextView extends AppCompatTextView implements RHelper<VectorRTextViewHelper> {

    private VectorRTextViewHelper mHelper;

    public MRTextView(Context context) {
        super(context);
    }

    public MRTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mHelper = new VectorRTextViewHelper(context, this, attrs);
    }


    @Override
    public VectorRTextViewHelper getHelper() {
        return mHelper;
    }

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        if (mHelper != null) mHelper.setEnabled(enabled);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mHelper != null) mHelper.onTouchEvent(event);
        return super.onTouchEvent(event);
    }

    @Override
    public void setSelected(boolean selected) {
        if (mHelper != null) mHelper.setSelected(selected);
        super.setSelected(selected);
    }
}
